package net.csdra.libraryborrowing.service.book;

import net.csdra.libraryborrowing.domain.book.BookCopy;
import net.csdra.libraryborrowing.service.PageEntity;
import org.springframework.data.domain.Page;

/**
 * Created by msf on 2017/10/16.
 */
public interface BookCopyService {
    /**
     * 根据Id获取副本
     *
     * @param getBookCopyById
     * @return
     */
    public BookCopy getBookCopeById(GetBookCopyById getBookCopyById);

    /**
     * 根据State和BookInfoId获取副本(返回1个)
     *
     * @param getBookCopyByState
     * @return
     */
    public BookCopy getBookCopyByState(GetBookCopyByState getBookCopyByState);

    /**
     * 根据BookInfoId（metaId）获取所有副本
     *
     * @param getBookCopyPageByBookInofoId
     * @return
     */
    public Page<BookCopy> getBookCopyPageByBookInofoId(GetBookCopyPageByBookInofoId getBookCopyPageByBookInofoId);

    class GetBookCopyById {
        String bookCopeId;

        public String getBookCopeId() {
            return bookCopeId;
        }

        public void setBookCopeId(String bookCopeId) {
            this.bookCopeId = bookCopeId;
        }
    }

    class GetBookCopyByState {
        String state;
        String bookInfoId;

        public String getBookInfoId() {
            return bookInfoId;
        }

        public void setBookInfoId(String bookInfoId) {
            this.bookInfoId = bookInfoId;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }
    }

    class GetBookCopyPageByBookInofoId extends PageEntity {
        String bookInfoId;

        public String getBookInfoId() {
            return bookInfoId;
        }

        public void setBookInfoId(String bookInfoId) {
            this.bookInfoId = bookInfoId;
        }
    }
}
